<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
<script>
            function radioButton(radio) {
            var id = radio.name.substring(radio.name.lastIndexOf(':'));
            var el = radio.form.elements;
            for (var i = 0; i < el.length; i++) {
                if (el[i].name.substring(el[i].name.lastIndexOf(':')) == id) {
                    el[i].checked = false;
                }
            }
            radio.checked = true;
        }
    </script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Montar Plano</title>
</head>
<f:view>
	<body>
	<h:form>
		<h:dataTable var="item" value="#{montarPlano.etapas}" border="2"
			width="100%" bgcolor="#BDDCFD"
			style="padding-left: 3px; padding-right: 3px; padding-top: 3px; cursor: text; padding-bottom: 3px">
			<h:column id="cidade">
				<f:facet name="header">
					<h:outputText value="Cidade"></h:outputText>
				</f:facet>
				<h:outputText value="#{item.cidadeJSP}"></h:outputText>
			</h:column>
			<h:column id="transporte">
				<f:facet name="header">
					<h:outputText value="Transporte"></h:outputText>
				</f:facet>
				<h:outputText value="#{item.transporteJSP}"></h:outputText>
			</h:column>
			<h:column id="hospedagem">
				<f:facet name="header">
					<h:outputText value="Hospedagem"></h:outputText>
				</f:facet>
				<h:outputText value="#{item.hospedagemJSP}"></h:outputText>
			</h:column>
			<h:column id="translado">
				<f:facet name="header">
					<h:outputText value="Translado"></h:outputText>
				</f:facet>
				<h:outputText value="#{item.transladoJSP}"></h:outputText>
			</h:column>
			<h:column id="valorParcial">
				<f:facet name="header">
					<h:outputText value="Valor Parcial"></h:outputText>
				</f:facet>
				<h:outputText value="#{item.valorEtapa}"></h:outputText>
			</h:column>
		</h:dataTable>
		<table width="100%">
		<tr><td>
		<h:outputLabel value="Cidade:"></h:outputLabel>
		<h:selectOneMenu binding="#{montarPlano.htmlSelectJSP}"
			value="#{montarPlano.cidadeEscolhidaID_JSP}" onchange="submit();"
			immediate="true" valueChangeListener="#{montarPlano.mudarLista}">
			<f:selectItems value="#{montarPlano.cidadesItemsJSP}"></f:selectItems>
		</h:selectOneMenu></td>
		<td align="right" style="width: 155px"><h:outputText value="#{montarPlano.valorPlano}"></h:outputText></td>
		</tr>
		</table>
		<table border="1" width="100%">
			<tr>
				<td><jsp:include page="transporte.jsp" /></TD>
				<td><jsp:include page="hospedagem.jsp" /></td>
				<td><jsp:include page="translado.jsp" /></td>
			</tr>
		</table>
		<hr>
		<table align="Center" width="30%">
			<tr>
				<td align="center"><h:commandButton value="Confirma"
					action="#{montarPlano.confirma}"></h:commandButton></td>
				<td align="center"><h:commandButton value="Cancela"
					action="#{montarPlano.cancelar}"></h:commandButton></td>
				<td align="center"><h:commandButton value="Concluir Plano"
					action="#{montarPlano.concluir}"></h:commandButton></td>
			</tr>
		</table>
	</h:form>
	</body>
</f:view>
</html>